var backUrl = $('#backUrl'), qrcode = $('#qrcode'), showNor = $('#showNor'), showError = $('#showError'), errorback = $('#errorback');
var pay = $('#pay');


function getUrl(c, d) {
	var d = d || "?";
	var a;
	if (d == "?") {
		a = location.search.substring(1).split("&")
	} else {
		a = location.hash.substring(1).split("&")
	}
	for (var b = 0; b < a.length; b++) {
		if (c == a[b].split("=")[0]) {
			return a[b].split("=")[1]
		}
	}
	return ""
}

var payUrl = $('#payurl').val(); //判断返回码code

if (payUrl) {

	var backurl_return = $('#backurl').val(); //返回上一页
	backUrl.attr('href', decodeURIComponent(backurl_return));

	pay.attr('href', decodeURIComponent(payUrl));
	showNor.show(); //页面展示

} else {
	var msg_return = $('#msg').val(); //错误码
	var error_url = $('#backurl').val();
	errorback.attr('href', decodeURIComponent(error_url));
	if (msg_return != '') {
		showError.find('p').html(msg_return);
	} else {
		showError.find('p').html('系统内部异常');
	}
	showError.show();
}
